package cn.webestar.scms.user.api;

import cn.webestar.scms.commons.R;
import cn.webestar.scms.commons.api.PageVO;
import cn.webestar.scms.user.api.dto.Log.*;
import cn.webestar.scms.user.entity.Log;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * 租户日志
 */
@Tag(name = "租户日志")
@FeignClient(contextId = "Log", name = "microsvc-user", path = "/svcapi/Log")
public interface LogApi {

    @Operation(summary = "create")
    @PostMapping("create")
    R<Log> create(@RequestBody LogCreateDTO body);

    @Operation(summary = "delete")
    @PostMapping("delete")
    R<Boolean> delete(@RequestParam("id") Long id);

    @Operation(summary = "update")
    @PostMapping("update")
    R<Log> update(@RequestBody LogUpdateDTO body);

    @Operation(summary = "findById")
    @PostMapping("findById")
    R<Log> findById(@RequestParam("id") Long id);

    @Operation(summary = "findByIds")
    @PostMapping("findByIds")
    R<Map<Long, Log>> findByIds(@RequestBody Set<Long> ids);

    @Operation(summary = "page")
    @PostMapping("page")
    R<PageVO<Log>> page(@RequestBody LogPageDTO body);

    @Operation(summary = "findOne")
    @PostMapping("findOne")
    R<Log> findOne(@RequestBody LogSimpleDTO body);

    @Operation(summary = "limitList")
    @PostMapping("limitList")
    R<List<Log>> limitList(@RequestBody LogLimitDTO body);

}
